<%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ include file="/WEB-INF/views/commons/taglibs.jsp"%>
    <%@ taglib prefix="sys" tagdir="/WEB-INF/tags" %>

<html>
    <head>
    <title>用户添加页面</title>
       <jsp:include page="../../../commons/common-add.jsp"></jsp:include>
        <script type="text/javascript" src="${basePath}/statics/modules/sys/user/js/user_add.js"></script>
    </head>
    <body>
    <sys:message msgContent="${message}"/>
    <div class="col-md-6">
    <form id="inputForm" action="user_save" method="post"  class="form-horizontal" role="form">
    <input type="hidden" id="id" name="id" value="${ empty user.id ? 0 :user.id}"/>
        <div class="top-form-element-margin">
        <div class="row form-group line-height-34">
            <label for="username" class="col-sm-3 control-label text-pull-right" >
                <b class="must-star">*</b>
                用户名:
            </label>
            <div class="col-sm-4">
               <input type="text" autofocus class="required form-control" id="username" name="username"  value="${user.username}">
            </div>
        </div>

        <div class="row form-group line-height-34" >
            <label for="realname" class="col-sm-3 control-label text-pull-right">
                <b style="color:red;">*</b>
                真实姓名:
            </label>
            <div class="col-sm-4">
                <input type="text" autofocus style="display: inline;" class="required form-control" id="realname" name="realname"  value="${user.realname}" >
            </div>
        </div>

        <div class="row form-group line-height-34">
            <label for="password" class="col-sm-3 control-label text-pull-right" >
                <c:if test="${empty user}"> <b style="color:red;">*</b></c:if>
                用户密码:
            </label>
            <div class="col-sm-4">
                <input type="password" style="display: inline;" class=" ${empty user ? 'required' : '' }  form-control" id="password" name="password"  maxlength="50" value=""/>
            </div>
        </div>

        <div class="row form-group line-height-34">
            <label for="rePassword"  class="col-sm-3 control-label text-pull-right">
                <c:if test="${empty user}"> <b style="color:red;">*</b></c:if>
                确认密码:
            </label>
            <div class="col-sm-4">
                <input type="password" style="display: inline;" class=" ${empty user ? 'required' : '' }   form-control" id="rePassword"  name="rePassword"   maxlength="50" value=""/>
            </div>
        </div>

        <div class="row form-group line-height-34">
            <label for="gender" class="col-sm-3 control-label text-pull-right" >性别:</label>
            <div class="col-sm-4">
                <input type="radio" name="gender" id="gender" value="0"  class="minimal  {required:true} "  ${empty user || user.gender == 0 ? 'checked':''}/>男&nbsp;&nbsp;
                <input type="radio" name="gender" id="gender2" value="1"  class="minimal " ${user.gender == 1 ? 'checked':''}/>女&nbsp;&nbsp;
                <input type="radio" name="gender" id="gender3" value="2"  class="minimal "  ${empty user.gender || user.gender == 2 ? 'checked':''}/>保密
            </div>
        </div>

        <div class="row form-group line-height-34">
            <label for="mobile" class="col-sm-3 control-label text-pull-right" >手机号码:</label>
            <div class="col-sm-4">
                <input id="mobile"  name="mobile" style="display: inline;" class="form-control" maxlength="50"  value="${user.mobile}"/>
            </div>
        </div>

        <div class="row form-group line-height-34">
            <label for="roleIds" class="col-sm-3 control-label text-pull-right" >角色:</label>
            <div class="col-sm-4">
                <sys:treeselect id="roleIds" name="roleIds" value="${selRoleIds}"
                                labelName="${selPermNames}" labelValue="${selRoleNames}"
                                title="角色列表"
                                url="/admin/sys/role/ajax_roles_tree" cssStyle="display:inline;" cssClass="form-control" checked="true" />
            </div>
        </div>

        <div class="row form-group line-height-34">
            <label  class="col-sm-3 control-label text-pull-right" >是否可用:</label>
            <div class="col-sm-4">
                <input type="radio"  class="minimal {required:true} " ${empty user.status || user.status == 0 ? 'checked':''}  name="status" id="status" value="0"   />启用&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio"  class="minimal"  name="status" id="status1" value="1"   ${ user.status == 1 ? 'checked':''}  }/>禁用
            </div>
        </div>

            <div class="form-group" style="text-align: center;">
                <shiro:hasPermission name="sys:user:save">
                    <input id="btnSubmit" class="btn btn-primary"  type="submit"  value="保存" />&nbsp;
                 </shiro:hasPermission>
                <input id="btnCancel" class="btn btn-cancle" style="margin-left: 20px" type="reset" value="重置" />
            </div>
        </div>
    </form>
    </div>
    </body>
</html>
